-
-
Couldn't load subscription status.
- Fork 200
Honor --public flag given to 'yarn run dev-server ...' #529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lyrixx,
That's definitely an issue, however we may require a bit more code here.
The example given in the dev-server doc doesn't specify the protocol, so I guess most people will try using that option without it... which breaks the manifest.json/entrypoints.json files.
For instance:
$ yarn encore dev-server --host 0.0.0.0 --port 8080 --public foo.local:80
// manifest.json
{
"main.css": "foo.local:80/main.css",
"main.js": "foo.local:80/main.js",
}// entrypoints.json
{
"entrypoints": {
"main": {
"css": [
"foo.local:80/main.css"
],
"js": [
"foo.local:80/main.js"
]
}
}
}I guess we should also look if the protocol is present in the value of --public and add it if necessary (there is also the --https option to take into account for that case).
|
Thanks for the review. I updated the PR. Is it better? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it seems to work perfectly, thank you :)
Just a small thing left to avoid an error when --public isn't followed by a string (argv.public becomes a boolean in that case, so .includes(...) doesn't work).
Co-Authored-By: lyrixx <lyrixx@lyrixx.info>
|
Nice one @lyrixx! Thank you! |
…xx, Lyrkan) This PR was merged into the master branch. Discussion ---------- Honor --public flag given to 'yarn run dev-server ...' I'm using docker (one container for the front, another one for webpack) and I had to do this PR to make it work. For reference, this is the command I (docker actually) executed ``` yarn run dev-server --host 0.0.0.0 --port 9999 --hot --public https://example.com:443 --disable-host-check ``` Commits ------- 5fb19de Update lib/config/parse-runtime.js 4275ff0 Honor --public flag given to 'yarn run dev-server ...'
I'm using docker (one container for the front, another one for webpack)
and I had to do this PR to make it work.
For reference, this is the command I (docker actually) executed